package io.p2p.stream.stun;

import io.p2p.stream.stun.model.StunSharedModel;
import io.p2p.stream.stun.service.StunUdpServer;
import lombok.extern.slf4j.Slf4j;
import java.util.Scanner;

@Slf4j
public class StunServiceStarter {

    public static void main(String[] args)  {

        StunUdpServer firstUdpServer = new StunUdpServer();
        firstUdpServer.start(StunSharedModel.stunServerFirstIP,StunSharedModel.stunServerFirstPort);

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入内容，输入 'exit' 退出：");

        // 无限循环，等待用户输入
        while (true) {
            String input = scanner.nextLine();

            // 如果用户输入了 "exit"，则退出循环
            if (input.equalsIgnoreCase("exit")) {
                break;
            }

            // 处理用户输入
            System.out.println("用户输入为: " + input);
        }

        // 关闭 Scanner
        scanner.close();
        System.out.println("程序退出。");
    }
}